﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DotNet.WinUI.Basic
{
    public partial class FormMessageBox : Form
    {
        public FormMessageBox()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FrmSingle objFrmSingle = new FrmSingle();
            objFrmSingle.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            FrmMulti objFrmMulti = new FrmMulti();
            objFrmMulti.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MessageBox.Show(textBox1.Text);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            MessageBox.Show("是否删除选择的数据记录？", "删除提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            textBox3.Text = MessageBox.Show("返回点击的操作", "消息框标题", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Asterisk).ToString();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "*.doc|*.doc|*.docx|*.docx|*.xls|*.xls|*.xlsx|*.xlsx";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox2.Text = openFileDialog1.FileName;
            }
        }
    }
}
